home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / AppleEvents.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  26.9 KB  |  669 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        AppleEvents.p
  3.  
  4.      Contains:    AppleEvent Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT AppleEvents;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __APPLEEVENTS__}
  30. {$SETC __APPLEEVENTS__ := 1}
  31.  
  32. {$I+}
  33. {$SETC AppleEventsIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __ERRORS__}
  38. {$I Errors.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __TYPES__}
  43. {$I Types.p}
  44. {$ENDC}
  45.  
  46. {$IFC UNDEFINED __MEMORY__}
  47. {$I Memory.p}
  48. {$ENDC}
  49. {    MixedMode.p                                                    }
  50.  
  51. {$IFC UNDEFINED __OSUTILS__}
  52. {$I OSUtils.p}
  53. {$ENDC}
  54.  
  55. {$IFC UNDEFINED __EVENTS__}
  56. {$I Events.p}
  57. {$ENDC}
  58. {    Quickdraw.p                                                    }
  59. {        QuickdrawText.p                                            }
  60.  
  61. {$IFC UNDEFINED __EPPC__}
  62. {$I EPPC.p}
  63. {$ENDC}
  64. {    AppleTalk.p                                                    }
  65. {    Files.p                                                        }
  66. {        Finder.p                                                }
  67. {    PPCToolbox.p                                                }
  68. {    Processes.p                                                    }
  69.  
  70. {$IFC UNDEFINED __NOTIFICATION__}
  71. {$I Notification.p}
  72. {$ENDC}
  73.  
  74. {$PUSH}
  75. {$ALIGN MAC68K}
  76. {$LibExport+}
  77.  
  78. CONST
  79. { Apple event descriptor types }
  80.     typeBoolean                    = 'bool';
  81.     typeChar                    = 'TEXT';
  82.     typeSMInt                    = 'shor';
  83.     typeInteger                    = 'long';
  84.     typeSMFloat                    = 'sing';
  85.     typeFloat                    = 'doub';
  86.     typeLongInteger                = 'long';
  87.     typeShortInteger            = 'shor';
  88.     typeLongFloat                = 'doub';
  89.     typeShortFloat                = 'sing';
  90.     typeExtended                = 'exte';
  91.     typeComp                    = 'comp';
  92.     typeMagnitude                = 'magn';
  93.     typeAEList                    = 'list';
  94.     typeAERecord                = 'reco';
  95.     typeAppleEvent                = 'aevt';
  96.     typeTrue                    = 'true';
  97.     typeFalse                    = 'fals';
  98.     typeAlias                    = 'alis';
  99.     typeEnumerated                = 'enum';
  100.     typeType                    = 'type';
  101.     typeAppParameters            = 'appa';
  102.     typeProperty                = 'prop';
  103.     typeFSS                        = 'fss ';
  104.     typeKeyword                    = 'keyw';
  105.     typeSectionH                = 'sect';
  106.     typeWildCard                = '****';
  107.     typeApplSignature            = 'sign';
  108.     typeQDRectangle                = 'qdrt';
  109.     typeFixed                    = 'fixd';
  110.     typeSessionID                = 'ssid';
  111.     typeTargetID                = 'targ';
  112.     typeProcessSerialNumber        = 'psn ';
  113.     typeNull                    = 'null';                        { null or nonexistent data }
  114. { Keywords for Apple event parameters }
  115.     keyDirectObject                = '----';
  116.     keyErrorNumber                = 'errn';
  117.     keyErrorString                = 'errs';
  118.     keyProcessSerialNumber        = 'psn ';
  119. { Keywords for Apple event attributes }
  120.     keyTransactionIDAttr        = 'tran';
  121.     keyReturnIDAttr                = 'rtid';
  122.     keyEventClassAttr            = 'evcl';
  123.     keyEventIDAttr                = 'evid';
  124.     keyAddressAttr                = 'addr';
  125.     keyOptionalKeywordAttr        = 'optk';
  126.     keyTimeoutAttr                = 'timo';
  127.     keyInteractLevelAttr        = 'inte';                        { this attribute is read only - will be set in AESend }
  128.     keyEventSourceAttr            = 'esrc';                        { this attribute is read only }
  129.     keyMissedKeywordAttr        = 'miss';                        { this attribute is read only }
  130.     keyOriginalAddressAttr        = 'from';                        { new in 1.0.1 }
  131. { Keywords for special handlers }
  132.     keyPreDispatch                = 'phac';                        { preHandler accessor call }
  133.     keySelectProc                = 'selh';                        { more selector call }
  134. { Keyword for recording }
  135.     keyAERecorderCount            = 'recr';                        { available only in vers 1.0.1 and greater }
  136. { Keyword for version information }
  137.     keyAEVersion                = 'vers';                        { available only in vers 1.0.1 and greater }
  138. { Event Class }
  139.     kCoreEventClass                = 'aevt';
  140. { Event ID’s }
  141.     kAEOpenApplication            = 'oapp';
  142.     kAEOpenDocuments            = 'odoc';
  143.     kAEPrintDocuments            = 'pdoc';
  144.     kAEQuitApplication            = 'quit';
  145.     kAEAnswer                    = 'ansr';
  146.     kAEApplicationDied            = 'obit';
  147.  
  148. { Constants for use in AESend mode }
  149.     kAENoReply                    = $00000001;                    { sender doesn't want a reply to event }
  150.     kAEQueueReply                = $00000002;                    { sender wants a reply but won't wait }
  151.     kAEWaitReply                = $00000003;                    { sender wants a reply and will wait }
  152.     kAENeverInteract            = $00000010;                    { server should not interact with user }
  153.     kAECanInteract                = $00000020;                    { server may try to interact with user }
  154.     kAEAlwaysInteract            = $00000030;                    { server should always interact with user where appropriate }
  155.     kAECanSwitchLayer            = $00000040;                    { interaction may switch layer }
  156.     kAEDontReconnect            = $00000080;                    { don't reconnect if there is a sessClosedErr from PPCToolbox }
  157.     kAEWantReceipt                = nReturnReceipt;                { sender wants a receipt of message }
  158.     kAEDontRecord                = $00001000;                    { don't record this event - available only in vers 1.0.1 and greater }
  159.     kAEDontExecute                = $00002000;                    { don't send the event for recording - available only in vers 1.0.1 and greater }
  160. { Constants for the send priority in AESend }
  161.     kAENormalPriority            = $00000000;                    { post message at the end of the event queue }
  162.     kAEHighPriority                = nAttnMsg;                        { post message at the front of the event queue }
  163.  
  164. { Constants for recording }
  165.     kAEStartRecording            = 'reca';                        { available only in vers 1.0.1 and greater }
  166.     kAEStopRecording            = 'recc';                        { available only in vers 1.0.1 and greater }
  167.     kAENotifyStartRecording        = 'rec1';                        { available only in vers 1.0.1 and greater }
  168.     kAENotifyStopRecording        = 'rec0';                        { available only in vers 1.0.1 and greater }
  169.     kAENotifyRecording            = 'recr';
  170.  
  171. { Constant for the returnID param of AECreateAppleEvent }
  172.     kAutoGenerateReturnID        = -1;                            { AECreateAppleEvent will generate a session-unique ID }
  173. { Constant for transaction ID’s }
  174.     kAnyTransactionID            = 0;                            { no transaction is in use }
  175. { Constants for timeout durations }
  176.     kAEDefaultTimeout            = -1;                            { timeout value determined by AEM }
  177.     kNoTimeOut                    = -2;                            { wait until reply comes back, however long it takes }
  178.  
  179. { Constants for AEResumeTheCurrentEvent }
  180.     kAENoDispatch                = 0;                            { dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch }
  181.     kAEUseStandardDispatch        = $FFFFFFFF;                    { table, or one of these two constants }
  182. { Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch }
  183.     kAEDoNotIgnoreHandler        = $00000000;
  184.     kAEIgnoreAppPhacHandler        = $00000001;                    { available only in vers 1.0.1 and greater }
  185.     kAEIgnoreAppEventHandler    = $00000002;                    { available only in vers 1.0.1 and greater }
  186.     kAEIgnoreSysPhacHandler        = $00000004;                    { available only in vers 1.0.1 and greater }
  187.     kAEIgnoreSysEventHandler    = $00000008;                    { available only in vers 1.0.1 and greater }
  188.     kAEIngoreBuiltInEventHandler = $00000010;                    { available only in vers 1.0.1 and greater }
  189.     kAEDontDisposeOnResume        = $80000000;                    { available only in vers 1.0.1 and greater }
  190.  
  191. { Apple event manager data types }
  192.     
  193. TYPE
  194.     AEEventClass = FourCharCode;
  195.  
  196.     AEEventID = FourCharCode;
  197.  
  198.     AEKeyword = FourCharCode;
  199.  
  200.     DescType = ResType;
  201.  
  202.     AEDesc = RECORD
  203.         descriptorType:            DescType;
  204.         dataHandle:                Handle;
  205.     END;
  206.  
  207.     AEKeyDesc = RECORD
  208.         descKey:                AEKeyword;
  209.         descContent:            AEDesc;
  210.     END;
  211.  
  212. { an AEDesc which contains address data }
  213.     AEAddressDesc = AEDesc;
  214.  
  215. { a list of AEDesc's is a special kind of AEDesc }
  216.     AEDescList = AEDesc;
  217.  
  218. { AERecord is a list of keyworded AEDesc's }
  219.     AERecord = AEDescList;
  220.  
  221. { an AERecord that contains an AppleEvent }
  222.     AppleEvent = AERecord;
  223.  
  224.     AESendMode = LONGINT;
  225.  
  226. { priority param of AESend }
  227.     AESendPriority = INTEGER;
  228.  
  229.  
  230. CONST
  231.     kAEInteractWithSelf            = 0;
  232.     kAEInteractWithLocal        = 1;
  233.     kAEInteractWithAll            = 2;
  234.  
  235.     
  236. TYPE
  237.     AEInteractAllowed = SInt8;
  238.  
  239.  
  240. CONST
  241.     kAEUnknownSource            = 0;
  242.     kAEDirectCall                = 1;
  243.     kAESameProcess                = 2;
  244.     kAELocalProcess                = 3;
  245.     kAERemoteProcess            = 4;
  246.  
  247.     
  248. TYPE
  249.     AEEventSource = SInt8;
  250.  
  251.  
  252. CONST
  253.     kAEDataArray                = 0;
  254.     kAEPackedArray                = 1;
  255.     kAEHandleArray                = 2;
  256.     kAEDescArray                = 3;
  257.     kAEKeyDescArray                = 4;
  258.  
  259.     
  260. TYPE
  261.     AEArrayType = SInt8;
  262.  
  263.     AEArrayData = RECORD
  264.         CASE INTEGER OF
  265.         0: (
  266.             kAEDataArray:                ARRAY [0..0] OF INTEGER;
  267.            );
  268.         1: (
  269.             kAEPackedArray:                PACKED ARRAY [0..0] OF CHAR;
  270.            );
  271.         2: (
  272.             kAEHandleArray:                ARRAY [0..0] OF Handle;
  273.            );
  274.         3: (
  275.             kAEDescArray:                ARRAY [0..0] OF AEDesc;
  276.            );
  277.         4: (
  278.             kAEKeyDescArray:            ARRAY [0..0] OF AEKeyDesc;
  279.            );
  280.     END;
  281.  
  282.     AEArrayDataPointer = ^AEArrayData;
  283.  
  284.     AEIdleProcPtr = ProcPtr;  { FUNCTION AEIdle(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle): BOOLEAN; }
  285.     AEFilterProcPtr = ProcPtr;  { FUNCTION AEFilter(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; (CONST)VAR sender: AEAddressDesc): BOOLEAN; }
  286.     AEEventHandlerProcPtr = ProcPtr;  { FUNCTION AEEventHandler((CONST)VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT): OSErr; }
  287.     AECoerceDescProcPtr = ProcPtr;  { FUNCTION AECoerceDesc((CONST)VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc): OSErr; }
  288.     AECoercePtrProcPtr = ProcPtr;  { FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc): OSErr; }
  289.     AEIdleUPP = UniversalProcPtr;
  290.     AEFilterUPP = UniversalProcPtr;
  291.     AEEventHandlerUPP = UniversalProcPtr;
  292.     AECoerceDescUPP = UniversalProcPtr;
  293.     AECoercePtrUPP = UniversalProcPtr;
  294.  
  295. CONST
  296.     uppAEIdleProcInfo = $00000FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 1 byte result; }
  297.     uppAEFilterProcInfo = $00003FD0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 1 byte result; }
  298.     uppAEEventHandlerProcInfo = $00000FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  299.     uppAECoerceDescProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  300.     uppAECoercePtrProcInfo = $0003FFE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  301.  
  302. FUNCTION NewAEIdleProc(userRoutine: AEIdleProcPtr): AEIdleUPP;
  303.     {$IFC NOT GENERATINGCFM }
  304.     INLINE $2E9F;
  305.     {$ENDC}
  306.  
  307. FUNCTION NewAEFilterProc(userRoutine: AEFilterProcPtr): AEFilterUPP;
  308.     {$IFC NOT GENERATINGCFM }
  309.     INLINE $2E9F;
  310.     {$ENDC}
  311.  
  312. FUNCTION NewAEEventHandlerProc(userRoutine: AEEventHandlerProcPtr): AEEventHandlerUPP;
  313.     {$IFC NOT GENERATINGCFM }
  314.     INLINE $2E9F;
  315.     {$ENDC}
  316.  
  317. FUNCTION NewAECoerceDescProc(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP;
  318.     {$IFC NOT GENERATINGCFM }
  319.     INLINE $2E9F;
  320.     {$ENDC}
  321.  
  322. FUNCTION NewAECoercePtrProc(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP;
  323.     {$IFC NOT GENERATINGCFM }
  324.     INLINE $2E9F;
  325.     {$ENDC}
  326.  
  327. FUNCTION CallAEIdleProc(VAR theEvent: EventRecord; VAR sleepTime: LONGINT; VAR mouseRgn: RgnHandle; userRoutine: AEIdleUPP): BOOLEAN;
  328.     {$IFC NOT GENERATINGCFM}
  329.     INLINE $205F, $4E90;
  330.     {$ENDC}
  331.  
  332. FUNCTION CallAEFilterProc(VAR theEvent: EventRecord; returnID: LONGINT; transactionID: LONGINT; {CONST}VAR sender: AEAddressDesc; userRoutine: AEFilterUPP): BOOLEAN;
  333.     {$IFC NOT GENERATINGCFM}
  334.     INLINE $205F, $4E90;
  335.     {$ENDC}
  336.  
  337. FUNCTION CallAEEventHandlerProc({CONST}VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; handlerRefcon: LONGINT; userRoutine: AEEventHandlerUPP): OSErr;
  338.     {$IFC NOT GENERATINGCFM}
  339.     INLINE $205F, $4E90;
  340.     {$ENDC}
  341.  
  342. FUNCTION CallAECoerceDescProc({CONST}VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc; userRoutine: AECoerceDescUPP): OSErr;
  343.     {$IFC NOT GENERATINGCFM}
  344.     INLINE $205F, $4E90;
  345.     {$ENDC}
  346.  
  347. FUNCTION CallAECoercePtrProc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc; userRoutine: AECoercePtrUPP): OSErr;
  348.     {$IFC NOT GENERATINGCFM}
  349.     INLINE $205F, $4E90;
  350.     {$ENDC}
  351.     
  352. TYPE
  353.     AECoercionHandlerUPP = UniversalProcPtr;
  354.  
  355. {*************************************************************************
  356.  The following calls apply to any AEDesc. Every 'result' descriptor is
  357.  created for you, so you will be responsible for memory management
  358.  (including disposing) of the descriptors so created. Note: purgeable
  359.  descriptor data is not supported - the AEM does not call LoadResource.  
  360. *************************************************************************}
  361.  
  362. FUNCTION AECreateDesc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; VAR result: AEDesc): OSErr;
  363.     {$IFC NOT GENERATINGCFM}
  364.     INLINE $303C, $0825, $A816;
  365.     {$ENDC}
  366. FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; VAR result: AEDesc): OSErr;
  367.     {$IFC NOT GENERATINGCFM}
  368.     INLINE $303C, $0A02, $A816;
  369.     {$ENDC}
  370. FUNCTION AECoerceDesc({CONST}VAR theAEDesc: AEDesc; toType: DescType; VAR result: AEDesc): OSErr;
  371.     {$IFC NOT GENERATINGCFM}
  372.     INLINE $303C, $0603, $A816;
  373.     {$ENDC}
  374. FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr;
  375.     {$IFC NOT GENERATINGCFM}
  376.     INLINE $303C, $0204, $A816;
  377.     {$ENDC}
  378. FUNCTION AEDuplicateDesc({CONST}VAR theAEDesc: AEDesc; VAR result: AEDesc): OSErr;
  379.     {$IFC NOT GENERATINGCFM}
  380.     INLINE $303C, $0405, $A816;
  381.     {$ENDC}
  382. {*************************************************************************
  383.   The following calls apply to AEDescList. Since AEDescList is a subtype of
  384.   AEDesc, the calls in the previous section can also be used for AEDescList.
  385.   All list and array indices are 1-based. If the data was greater than
  386.   maximumSize in the routines below, then actualSize will be greater than
  387.   maximumSize, but only maximumSize bytes will actually be retrieved.
  388. *************************************************************************}
  389. FUNCTION AECreateList(factoringPtr: UNIV Ptr; factoredSize: Size; isRecord: BOOLEAN; VAR resultList: AEDescList): OSErr;
  390.     {$IFC NOT GENERATINGCFM}
  391.     INLINE $303C, $0706, $A816;
  392.     {$ENDC}
  393. FUNCTION AECountItems({CONST}VAR theAEDescList: AEDescList; VAR theCount: LONGINT): OSErr;
  394.     {$IFC NOT GENERATINGCFM}
  395.     INLINE $303C, $0407, $A816;
  396.     {$ENDC}
  397. FUNCTION AEPutPtr(VAR theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  398.     {$IFC NOT GENERATINGCFM}
  399.     INLINE $303C, $0A08, $A816;
  400.     {$ENDC}
  401. FUNCTION AEPutDesc(VAR theAEDescList: AEDescList; index: LONGINT; {CONST}VAR theAEDesc: AEDesc): OSErr;
  402.     {$IFC NOT GENERATINGCFM}
  403.     INLINE $303C, $0609, $A816;
  404.     {$ENDC}
  405. FUNCTION AEGetNthPtr({CONST}VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  406.     {$IFC NOT GENERATINGCFM}
  407.     INLINE $303C, $100A, $A816;
  408.     {$ENDC}
  409. FUNCTION AEGetNthDesc({CONST}VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR result: AEDesc): OSErr;
  410.     {$IFC NOT GENERATINGCFM}
  411.     INLINE $303C, $0A0B, $A816;
  412.     {$ENDC}
  413. FUNCTION AESizeOfNthItem({CONST}VAR theAEDescList: AEDescList; index: LONGINT; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  414.     {$IFC NOT GENERATINGCFM}
  415.     INLINE $303C, $082A, $A816;
  416.     {$ENDC}
  417. FUNCTION AEGetArray({CONST}VAR theAEDescList: AEDescList; arrayType: ByteParameter; arrayPtr: AEArrayDataPointer; maximumSize: Size; VAR itemType: DescType; VAR itemSize: Size; VAR itemCount: LONGINT): OSErr;
  418.     {$IFC NOT GENERATINGCFM}
  419.     INLINE $303C, $0D0C, $A816;
  420.     {$ENDC}
  421. FUNCTION AEPutArray(VAR theAEDescList: AEDescList; arrayType: ByteParameter; {CONST}VAR arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: LONGINT): OSErr;
  422.     {$IFC NOT GENERATINGCFM}
  423.     INLINE $303C, $0B0D, $A816;
  424.     {$ENDC}
  425. FUNCTION AEDeleteItem(VAR theAEDescList: AEDescList; index: LONGINT): OSErr;
  426.     {$IFC NOT GENERATINGCFM}
  427.     INLINE $303C, $040E, $A816;
  428.     {$ENDC}
  429. {*************************************************************************
  430.  The following calls apply to AERecord. Since AERecord is a subtype of
  431.  AEDescList, the calls in the previous sections can also be used for
  432.  AERecord an AERecord can be created by using AECreateList with isRecord
  433.  set to true. 
  434. *************************************************************************}
  435. {
  436.   Note: none of the “key” calls are currently available in the PowerPC IntefaceLib.
  437.   In C, a #define is used to map “key” calls to “param” calls.  In pascal
  438.   this mapping is done in externally linked glue code. 
  439.   See AppleEvents.h for more details.
  440. }
  441. FUNCTION AEPutKeyPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  442.     {$IFC NOT GENERATINGCFM}
  443.     INLINE $303C, $0A0F, $A816;
  444.     {$ENDC}
  445. FUNCTION AEPutKeyDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr;
  446.     {$IFC NOT GENERATINGCFM}
  447.     INLINE $303C, $0610, $A816;
  448.     {$ENDC}
  449. FUNCTION AEGetKeyPtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  450.     {$IFC NOT GENERATINGCFM}
  451.     INLINE $303C, $0E11, $A816;
  452.     {$ENDC}
  453. FUNCTION AEGetKeyDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  454.     {$IFC NOT GENERATINGCFM}
  455.     INLINE $303C, $0812, $A816;
  456.     {$ENDC}
  457. FUNCTION AESizeOfKeyDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  458.     {$IFC NOT GENERATINGCFM}
  459.     INLINE $303C, $0829, $A816;
  460.     {$ENDC}
  461. FUNCTION AEDeleteKeyDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  462.     {$IFC NOT GENERATINGCFM}
  463.     INLINE $303C, $0413, $A816;
  464.     {$ENDC}
  465. {*************************************************************************
  466.   The following calls are used to pack and unpack parameters from records
  467.   of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
  468.   in the previous sections can also be used for variables of type
  469.   AppleEvent. The next six calls are in fact identical to the six calls
  470.   for AERecord.
  471. *************************************************************************}
  472. FUNCTION AEPutParamPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  473.     {$IFC NOT GENERATINGCFM}
  474.     INLINE $303C, $0A0F, $A816;
  475.     {$ENDC}
  476. FUNCTION AEPutParamDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr;
  477.     {$IFC NOT GENERATINGCFM}
  478.     INLINE $303C, $0610, $A816;
  479.     {$ENDC}
  480. FUNCTION AEGetParamPtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  481.     {$IFC NOT GENERATINGCFM}
  482.     INLINE $303C, $0E11, $A816;
  483.     {$ENDC}
  484. FUNCTION AEGetParamDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  485.     {$IFC NOT GENERATINGCFM}
  486.     INLINE $303C, $0812, $A816;
  487.     {$ENDC}
  488. FUNCTION AESizeOfParam({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  489.     {$IFC NOT GENERATINGCFM}
  490.     INLINE $303C, $0829, $A816;
  491.     {$ENDC}
  492. FUNCTION AEDeleteParam(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr;
  493.     {$IFC NOT GENERATINGCFM}
  494.     INLINE $303C, $0413, $A816;
  495.     {$ENDC}
  496. {*************************************************************************
  497.  The following calls also apply to type AppleEvent. Message attributes are
  498.  far more restricted, and can only be accessed through the following 5
  499.  calls. The various list and record routines cannot be used to access the
  500.  attributes of an event. 
  501. *************************************************************************}
  502. FUNCTION AEGetAttributePtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr;
  503.     {$IFC NOT GENERATINGCFM}
  504.     INLINE $303C, $0E15, $A816;
  505.     {$ENDC}
  506. FUNCTION AEGetAttributeDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr;
  507.     {$IFC NOT GENERATINGCFM}
  508.     INLINE $303C, $0826, $A816;
  509.     {$ENDC}
  510. FUNCTION AESizeOfAttribute({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr;
  511.     {$IFC NOT GENERATINGCFM}
  512.     INLINE $303C, $0828, $A816;
  513.     {$ENDC}
  514. FUNCTION AEPutAttributePtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr;
  515.     {$IFC NOT GENERATINGCFM}
  516.     INLINE $303C, $0A16, $A816;
  517.     {$ENDC}
  518. FUNCTION AEPutAttributeDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr;
  519.     {$IFC NOT GENERATINGCFM}
  520.     INLINE $303C, $0627, $A816;
  521.     {$ENDC}
  522. {*************************************************************************
  523.   The next couple of calls are basic routines used to create, send,
  524.   and process AppleEvents. 
  525. *************************************************************************}
  526. FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; {CONST}VAR target: AEAddressDesc; returnID: INTEGER; transactionID: LONGINT; VAR result: AppleEvent): OSErr;
  527.     {$IFC NOT GENERATINGCFM}
  528.     INLINE $303C, $0B14, $A816;
  529.     {$ENDC}
  530. FUNCTION AESend({CONST}VAR theAppleEvent: AppleEvent; VAR reply: AppleEvent; sendMode: AESendMode; sendPriority: AESendPriority; timeOutInTicks: LONGINT; idleProc: AEIdleUPP; filterProc: AEFilterUPP): OSErr;
  531.     {$IFC NOT GENERATINGCFM}
  532.     INLINE $303C, $0D17, $A816;
  533.     {$ENDC}
  534. FUNCTION AEProcessAppleEvent({CONST}VAR theEventRecord: EventRecord): OSErr;
  535.     {$IFC NOT GENERATINGCFM}
  536.     INLINE $303C, $021B, $A816;
  537.     {$ENDC}
  538.  Note: during event processing, an event handler may realize that it is likely
  539.  to exceed the client's timeout limit. Passing the reply to this
  540.  routine causes a wait event to be generated that asks the client
  541.  for more time. 
  542. }
  543. FUNCTION AEResetTimer({CONST}VAR reply: AppleEvent): OSErr;
  544.     {$IFC NOT GENERATINGCFM}
  545.     INLINE $303C, $0219, $A816;
  546.     {$ENDC}
  547. {*************************************************************************
  548.  The following four calls are available for applications which need more
  549.  sophisticated control over when and how events are processed. Applications
  550.  which implement multi-session servers or which implement their own
  551.  internal event queueing will probably be the major clients of these
  552.  routines. They can be called from within a handler to prevent the AEM from
  553.  disposing of the AppleEvent when the handler returns. They can be used to
  554.  asynchronously process the event (as MacApp does).
  555. *************************************************************************}
  556. FUNCTION AESuspendTheCurrentEvent({CONST}VAR theAppleEvent: AppleEvent): OSErr;
  557.     {$IFC NOT GENERATINGCFM}
  558.     INLINE $303C, $022B, $A816;
  559.     {$ENDC}
  560.  Note: The following routine tells the AppleEvent manager that processing
  561.  is either about to resume or has been completed on a previously suspended
  562.  event. The procPtr passed in as the dispatcher parameter will be called to
  563.  attempt to redispatch the event. Several constants for the dispatcher
  564.  parameter allow special behavior. They are:
  565.       - kAEUseStandardDispatch means redispatch as if the event was just
  566.       received, using the standard AppleEvent dispatch mechanism.
  567.       - kAENoDispatch means ignore the parameter.
  568.          Use this in the case where the event has been handled and no
  569.       redispatch is needed.
  570.       - non nil means call the routine which the dispatcher points to.
  571. }
  572. FUNCTION AEResumeTheCurrentEvent({CONST}VAR theAppleEvent: AppleEvent; {CONST}VAR reply: AppleEvent; dispatcher: AEEventHandlerUPP; handlerRefcon: LONGINT): OSErr;
  573.     {$IFC NOT GENERATINGCFM}
  574.     INLINE $303C, $0818, $A816;
  575.     {$ENDC}
  576. FUNCTION AEGetTheCurrentEvent(VAR theAppleEvent: AppleEvent): OSErr;
  577.     {$IFC NOT GENERATINGCFM}
  578.     INLINE $303C, $021A, $A816;
  579.     {$ENDC}
  580. FUNCTION AESetTheCurrentEvent({CONST}VAR theAppleEvent: AppleEvent): OSErr;
  581.     {$IFC NOT GENERATINGCFM}
  582.     INLINE $303C, $022C, $A816;
  583.     {$ENDC}
  584. {*************************************************************************
  585.   The following three calls are used to allow applications to behave
  586.   courteously when a user interaction such as a dialog box is needed. 
  587. *************************************************************************}
  588. FUNCTION AEGetInteractionAllowed(VAR level: AEInteractAllowed): OSErr;
  589.     {$IFC NOT GENERATINGCFM}
  590.     INLINE $303C, $021D, $A816;
  591.     {$ENDC}
  592. FUNCTION AESetInteractionAllowed(level: ByteParameter): OSErr;
  593.     {$IFC NOT GENERATINGCFM}
  594.     INLINE $303C, $011E, $A816;
  595.     {$ENDC}
  596. FUNCTION AEInteractWithUser(timeOutInTicks: LONGINT; nmReqPtr: NMRecPtr; idleProc: AEIdleUPP): OSErr;
  597.     {$IFC NOT GENERATINGCFM}
  598.     INLINE $303C, $061C, $A816;
  599.     {$ENDC}
  600. {*************************************************************************
  601.   These calls are used to set up and modify the event dispatch table.
  602. *************************************************************************}
  603. FUNCTION AEInstallEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  604.     {$IFC NOT GENERATINGCFM}
  605.     INLINE $303C, $091F, $A816;
  606.     {$ENDC}
  607. FUNCTION AERemoveEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; handler: AEEventHandlerUPP; isSysHandler: BOOLEAN): OSErr;
  608.     {$IFC NOT GENERATINGCFM}
  609.     INLINE $303C, $0720, $A816;
  610.     {$ENDC}
  611. FUNCTION AEGetEventHandler(theAEEventClass: AEEventClass; theAEEventID: AEEventID; VAR handler: AEEventHandlerUPP; VAR handlerRefcon: LONGINT; isSysHandler: BOOLEAN): OSErr;
  612.     {$IFC NOT GENERATINGCFM}
  613.     INLINE $303C, $0921, $A816;
  614.     {$ENDC}
  615. {*************************************************************************
  616.   These calls are used to set up and modify the coercion dispatch table.
  617. *************************************************************************}
  618. FUNCTION AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  619.     {$IFC NOT GENERATINGCFM}
  620.     INLINE $303C, $0A22, $A816;
  621.     {$ENDC}
  622. FUNCTION AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: BOOLEAN): OSErr;
  623.     {$IFC NOT GENERATINGCFM}
  624.     INLINE $303C, $0723, $A816;
  625.     {$ENDC}
  626. FUNCTION AEGetCoercionHandler(fromType: DescType; toType: DescType; VAR handler: AECoercionHandlerUPP; VAR handlerRefcon: LONGINT; VAR fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr;
  627.     {$IFC NOT GENERATINGCFM}
  628.     INLINE $303C, $0B24, $A816;
  629.     {$ENDC}
  630. {*************************************************************************
  631.   These calls are used to set up and modify special hooks into the
  632.   AppleEvent manager.
  633. *************************************************************************}
  634. FUNCTION AEInstallSpecialHandler(functionClass: AEKeyword; handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  635.     {$IFC NOT GENERATINGCFM}
  636.     INLINE $303C, $0500, $A816;
  637.     {$ENDC}
  638. FUNCTION AERemoveSpecialHandler(functionClass: AEKeyword; handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  639.     {$IFC NOT GENERATINGCFM}
  640.     INLINE $303C, $0501, $A816;
  641.     {$ENDC}
  642. FUNCTION AEGetSpecialHandler(functionClass: AEKeyword; VAR handler: UniversalProcPtr; isSysHandler: BOOLEAN): OSErr;
  643.     {$IFC NOT GENERATINGCFM}
  644.     INLINE $303C, $052D, $A816;
  645.     {$ENDC}
  646. {*************************************************************************
  647.   This call was added in version 1.0.1. If called with the keyword
  648.   keyAERecorderCount ('recr'), the number of recorders that are
  649.   currently active is returned in 'result'.
  650. *************************************************************************}
  651. { available only in vers 1.0.1 and greater }
  652. FUNCTION AEManagerInfo(keyWord: AEKeyword; VAR result: LONGINT): OSErr;
  653.     {$IFC NOT GENERATINGCFM}
  654.     INLINE $303C, $0441, $A816;
  655.     {$ENDC}
  656.  
  657. {$ALIGN RESET}
  658. {$POP}
  659.  
  660. {$SETC UsingIncludes := AppleEventsIncludes}
  661.  
  662. {$ENDC} {__APPLEEVENTS__}
  663.  
  664. {$IFC NOT UsingIncludes}
  665.  END.
  666. {$ENDC}
  667.